//
//  NSString+enCodeUrl.m
//  MacWeb
//
//  Created by 小贝 on 16/3/15.
//  Copyright © 2016年 Boye. All rights reserved.
//

#import "NSString+enCodeUrl.h"

@implementation NSString (enCodeUrl)
+(NSString *)URLEncodedString:(NSString *)urlStr
{
    NSString *encodedString = (NSString *)
    CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                            (CFStringRef)urlStr,
                                            (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",
                                            NULL,
                                            kCFStringEncodingUTF8));
    return encodedString;
}
@end
